




export interface ICall<TParam> {
  callFunc: (arg: TParam) => Promise<any>;
  param: TParam | (() => TParam);
  delay?: number;
  key: string;
  conditions?: IConditions;
}

export type CondintionType = 'some' | 'every';
export type StateType = 'success' | 'error' | 'warn'; 

export interface IConditions {
  type: CondintionType;
  conditionList: {
    key: string;
    state: StateType;
    is: boolean;
  }[];
}

export interface IStatePool {
  [key: string]: IStatePoolItem;
};

export interface IStatePoolItem {
  updateTime: number;
  count: number;
  is: boolean;
  msgList: string[];
};

export interface ISerivalHooks {
  /**
   * 单次请求
   */
  next: (fn: (res: any) => void) => ISerivalHooks; 
  error: (fn: (err: any) => void) => ISerivalHooks;
  /**
   * 所有请求
   */
  then: (fn: (res: any) => void) => ISerivalHooks;
  catch: (fn: (err: any) => void) => ISerivalHooks;
}

export interface IStringKeyObj {
  [key: string]: any;
}
